<?php 
defined('_JEXEC') or die('Access Deny');
class modHelloWorldHelper
{
	public static function getTitle()
	{
		return"This is my Title";
	}
	public static function getPeoples()
	{
	$arr=array('user1','user2','user3');
	return $arr;
	}
	public static function getImages(&$params){
		
		$imgsAndCaps = array(); 
		$load=JURI::root().'/modules/mod_helloworld/assets/img/spinner.gif';
		$i = 1;
		
		while($i <= 10) :
		
			
			// if image + caption + link
			if( ($params->get('image'.$i)) && ($params->get('image'.$i.'cap')) && ($params->get('image'.$i.'customlink') != '') ) {
				
					$listitem = "<div><a target='".$params->get('target')."' href='".$params->get('image'.$i.'customlink')."'><img  u=image  src2='".JURI::root().$params->get('image'.$i)."' alt='".$params->get('image'.$i.'alt')."'  style=' height:".$params->get('imageheight')."px ;width:".$params->get('imagewidth')."px;' /></a><div u=thumb>".$params->get('image'.$i.'cap')."</div></div>";
					array_push($imgsAndCaps, $listitem);
				
			
			// if image + no caption + link
			} else if ( ($params->get('image'.$i)) && ($params->get('image'.$i.'cap') == null) && ($params->get('image'.$i.'customlink') != '') ) {
				
					$listitem = "<li><a target='".$params->get('target')."' href='".$params->get('image'.$i.'customlink')."'><img title='' data-thumb='".$params->get('image'.$i.'name')."' alt='".$params->get('image'.$i.'alt')."' src2='".JURI::root().$params->get('image'.$i)."' /></a></li>";
					array_push($imgsAndCaps, $listitem);
				

			// if image + caption + no link
			} else if ( ($params->get('image'.$i)) && ($params->get('image'.$i.'customlink') == '') ) {
				
					$listitem = "<div><img  u=image  src2='".JURI::root().$params->get('image'.$i)."'  alt='".$params->get('image'.$i.'alt')."'/><div u=thumb>".$params->get('image'.$i.'cap')."</div></div>";
					array_push($imgsAndCaps, $listitem);
				
			
			// if image + no caption + no link
			} 
			// else if ( ($params->get('image'.$i)) && ($params->get('image'.$i.'cap') == null) && ($params->get('image'.$i.'customlink') == '') ) {
				
					// $listitem = "<div><img title='' data-thumb='".$params->get('image'.$i.'name')."' alt='".$params->get('image'.$i.'alt')."' src='".JURI::root().$params->get('image'.$i)."' /><div u=thumb>".$params->get('image'.$i.'cap')."</div></a></div>";
					// array_push($imgsAndCaps, $listitem);
			// }		
		
		$i++;
		
		endwhile;
		
		return $imgsAndCaps;
		
	}
	
	public static function getImagesStyle(&$params){
		
		$listName = array(); 
		
		$o = 1;
		
		while($o <= 10) :
			$imgsName=$params->get('image'.$o.'style');
			
			array_push($listName,$imgsName);
		$o++;
		endwhile;
		
		return $listName;
		
	}
}